package indi.jp.project.business.device.dao;

import indi.jp.project.business.device.entity.Device;
import indi.jp.project.business.device.entity.DeviceHistory;
import indi.jp.project.business.device.entity.dto.DeviceHistoryDTO;
import indi.jp.project.business.device.entity.dto.DeviceChangeDTO;
import org.apache.ibatis.annotations.Mapper;

import java.sql.SQLException;
import java.util.List;

/**
 * 设备DAO
 *
 * @author jiangping
 * @date 2022/5/16
 */
@Mapper
public interface DeviceDAO {

    List<Device> queryList(Device query) throws SQLException;

    int queryCount(Device query) throws SQLException;

    int insert(Device entity) throws SQLException;

    int update(Device entity) throws SQLException;

    int deleteById(String id) throws SQLException;

    Device findById(String id) throws SQLException;

    void batchInsertDevice(List<Device> list) throws SQLException;

    void updateDevice(List<DeviceChangeDTO> list) throws SQLException;

    void saveDeviceHistory(List<DeviceHistoryDTO> list) throws SQLException;

    List<DeviceHistory> queryHistoryList(String deviceId) throws SQLException;

    int queryHistoryCount(String id) throws SQLException;
}
